
const state = {
  userInfo: JSON.parse(localStorage.getItem('userInfo') || '{ }')
}
const mutations = {
  // 更新用户信息
  updateUser (state, user) {
    state.userInfo = user
  },
  // 清除用户信息
  delUser (state) {
    state.userInfo = null
    localStorage.removeItem('userInfo')
  }
}
const actions = {}
const getters = {}
export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
